<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="HTTP RESTful Interface to the Cask Data Application Platform" name="description" />
<meta content="Copyright © 2018 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>Profile HTTP RESTful API</title>

    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../index.html" />
    <link rel="up" title="CDAP HTTP RESTful API v3" href="index.html" />
    <link rel="next" title="Query HTTP RESTful API" href="query.html" />
    <link rel="prev" title="Preferences HTTP RESTful API" href="preferences.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: reference-manual -->
<!-- theme_manual_highlight: reference -->
<!-- sidebar_title_link: Reference -->

  <div role="note" aria-label="manuals links"><h3>Reference</h3>
    <ul class="reference-page-menu">
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html"> Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../characters.html"> Supported Characters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cli-api.html"> Command Line Interface API</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html"> HTTP RESTful API</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="artifact.html">Artifact</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="dataset.html">Dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="lifecycle.html">Lifecycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="metrics.html">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="namespace.html">Namespace</a></li>
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">Dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="preferences.html">Preferences</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Profile</a></li>
<li class="toctree-l2"><a class="reference internal" href="query.html">Query</a></li>
<li class="toctree-l2"><a class="reference internal" href="reports.html">Reports</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="service.html">Service</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="workflow.html">Workflow</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../java-client-api.html"> Java Client API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../javadocs/index.html"> Javadocs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release-notes.html"> 发行说明</a></li>
<li class="toctree-l1"><a class="reference internal" href="../licenses/index.html"> Trademarks, Licenses, and Dependencies</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html"> 术语表</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html"> Index</a></li>
</ul>
</nav>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="profile-http-restful-api">
<span id="http-restful-api-profile"></span><h1>Profile HTTP RESTful API<a class="headerlink" href="#profile-http-restful-api" title="Permalink to this headline">🔗</a></h1>
<p>Use the CDAP Profile HTTP RESTful API to create profiles, list available profiles, and
retrieve information about profiles</p>
<p>All methods or endpoints described in this API have a base URL (typically
<code class="docutils literal notranslate"><span class="pre">http://&lt;host&gt;:11015</span></code> or <code class="docutils literal notranslate"><span class="pre">https://&lt;host&gt;:10443</span></code>) that precedes the resource
identifier, as described in the <a class="reference internal" href="introduction.html#http-restful-api-conventions-base-url"><span class="std std-ref">RESTful API Conventions</span></a>.
These methods return a status code, as listed in the <a class="reference internal" href="introduction.html#http-restful-api-status-codes"><span class="std std-ref">RESTful API  Status Codes</span></a>.</p>
<div class="section" id="write-a-profile">
<span id="http-restful-api-profile-write"></span><h2>Write a Profile<a class="headerlink" href="#write-a-profile" title="Permalink to this headline">🔗</a></h2>
<p>A system profile can be created or updated with an HTTP PUT method to the URL:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">PUT /v3/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>A user profile can be created or updated with an HTTP PUT method to the URL:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">PUT /v3/namespaces/&lt;namespace-id&gt;/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>The request body must be a JSON object that specifies the profile details.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> PUT /v3/namespace/default/profiles/dataproc -d
{
  &quot;label&quot;: &quot;Dataproc&quot;,
  &quot;description&quot;: &quot;My Dataproc profile&quot;,
  &quot;provisioner&quot;: {
    &quot;name&quot;: &quot;gcp-dataproc&quot;,
    &quot;properties&quot;: [
      {
        &quot;name&quot;: &quot;projectId&quot;,
        &quot;value&quot;: &quot;my project id&quot;,
        &quot;isEditable&quot;: false
      },
      ...
    ]
  }
}
</pre>
</div>
</div>
<div class="section" id="list-profiles">
<span id="http-restful-api-profile-list"></span><h2>List Profiles<a class="headerlink" href="#list-profiles" title="Permalink to this headline">🔗</a></h2>
<p>To list all system profiles, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/profiles</span>
</pre></div>
</div>
<p>To list all user profiles, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/profiles[?includeSystem=true]</span>
</pre></div>
</div>
<p>This will return a JSON array that lists each profile. For the user profiles endpoint, if
the <cite>includeSystem</cite> query param is set to <cite>true</cite>, all system profiles will also be returned
in the response.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/profiles
[
  {
    &quot;name&quot;: &quot;dataproc&quot;,
    &quot;label&quot;: &quot;Dataproc&quot;,
    &quot;description&quot;: &quot;My Dataproc Profile&quot;,
    &quot;scope&quot;: &quot;SYSTEM&quot;,
    &quot;status&quot;: &quot;ENABLED&quot;,
    &quot;created&quot;: 1234567890,
    &quot;provisioner&quot;: {
      &quot;name&quot;: &quot;gcp-dataproc&quot;,
      &quot;properties&quot;: [
        {
          &quot;name&quot;: &quot;projectId&quot;,
          &quot;value&quot;: &quot;my project id&quot;,
          &quot;isEditable&quot;: false
        },
        ...
      ]
    }
  },
  ...
]
</pre>
</div>
</div>
<div class="section" id="retrieve-profile-details">
<span id="http-restful-api-profile-detail"></span><h2>Retrieve Profile Details<a class="headerlink" href="#retrieve-profile-details" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve details about a system profile, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>To retrieve details about a user profile, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>This will return a JSON object that contains details about the profile.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/profiles/dataproc
{
  &quot;name&quot;: &quot;dataproc&quot;,
  &quot;label&quot;: &quot;Dataproc&quot;,
  &quot;description&quot;: &quot;My Dataproc Profile&quot;,
  &quot;scope&quot;: &quot;SYSTEM&quot;,
  &quot;status&quot;: &quot;ENABLED&quot;,
  &quot;created&quot;: 1234567890,
  &quot;provisioner&quot;: {
    &quot;name&quot;: &quot;gcp-dataproc&quot;,
    &quot;properties&quot;: [
      {
        &quot;name&quot;: &quot;projectId&quot;,
        &quot;value&quot;: &quot;my project id&quot;,
        &quot;isEditable&quot;: false
      },
      ...
    ]
  }
}
</pre>
</div>
</div>
<div class="section" id="disable-profile">
<span id="http-restful-api-profile-disable"></span><h2>Disable Profile<a class="headerlink" href="#disable-profile" title="Permalink to this headline">🔗</a></h2>
<p>To disable a system profile, submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/profiles/&lt;profile-name&gt;/disable</span>
</pre></div>
</div>
<p>To disable a user profile, submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/namespaces/&lt;namespace-id&gt;/profiles/&lt;profile-name&gt;/disable</span>
</pre></div>
</div>
</div>
<div class="section" id="enable-profile">
<span id="http-restful-api-profile-enable"></span><h2>Enable Profile<a class="headerlink" href="#enable-profile" title="Permalink to this headline">🔗</a></h2>
<p>To enable a system profile, submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/profiles/&lt;profile-name&gt;/enable</span>
</pre></div>
</div>
<p>To enable a user profile, submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/namespaces/&lt;namespace-id&gt;/profiles/&lt;profile-name&gt;/enable</span>
</pre></div>
</div>
</div>
<div class="section" id="delete-profile">
<span id="http-restful-api-profile-delete"></span><h2>Delete Profile<a class="headerlink" href="#delete-profile" title="Permalink to this headline">🔗</a></h2>
<p>To delete a system profile, submit an HTTP DELETE request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>To delete a user profile, submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/namespaces/&lt;namespace-id&gt;/profiles/&lt;profile-name&gt;</span>
</pre></div>
</div>
<p>In order to delete a profile, the profile must be disabled, it must
not be assigned to any entity, and it must not be in use by any active
program runs. If any of these conditions is not met, a 409 will be returned.</p>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="Preferences HTTP RESTful API" href="preferences.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="Query HTTP RESTful API" href="query.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../_static/js/js.cookie.js"></script><script type="text/javascript" src="../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>